<script setup lang="ts">
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app';
import { useUserStore } from '@/store/modules/user';
import { useSocketStore } from '@/store/modules/webSocket';
import checkShowPage from '@/utils/checkShowPage';

onLaunch(() => {
  const initData = uni.getLaunchOptionsSync();
  const res = checkShowPage.checkStart(initData.path);
  if (res) {
    // 创建webSocket链接
    useSocketStore().initSocket();
    //创建SSE链接
    initSSE();
    useUserStore().getAllMsg();
  }
});

onShow(() => {
});

onHide(() => {
});
</script>

<style lang="scss">
@import 'uview-plus/index.scss';
</style>
